import React from 'react'
import { Badge, TabBar } from 'antd-mobile'
import {tabBarRoutes} from '../../router'
import { useNavigate,useLocation } from 'react-router-dom'
import style from './index.module.css'
function Index() {
    const navigate=useNavigate()
  const location = useLocation()
  const { pathname } = location

  
  return (
    <div style={{height:'50px'}}>
        <div className={style['tarbar']}>

        
      <TabBar activeKey={pathname} onChange={value => navigate(value)}>
      {tabBarRoutes.map(item => (
        <TabBar.Item key={item.path} icon={item.icon} title={item.title} />
      ))}
    </TabBar>
    </div>
    </div>
  )
}

export default Index
